package com.yitong.equipment.ui.adapter

import com.chad.library.adapter.base.BaseNodeAdapter
import com.chad.library.adapter.base.entity.node.BaseNode
import com.yitong.equipment.ui.adapter.courseprovider.FirstData
import com.yitong.equipment.ui.adapter.courseprovider.FirstProvider
import com.yitong.equipment.ui.adapter.courseprovider.SecondData
import com.yitong.equipment.ui.adapter.courseprovider.SecondProvider

class CourseDetailAdapter: BaseNodeAdapter() {
    init {
        addNodeProvider(FirstProvider())
        addNodeProvider(SecondProvider())
    }
    override fun getItemType(data: List<BaseNode>, position: Int): Int {

        var baseNode = data[position]
        if (baseNode is FirstData) {
            return 1
        }else if (baseNode is SecondData) {
            return 2
        }
        return -1
    }
}
